﻿@{
    ViewBag.Title = "Common Command";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
       <ol class="breadcrumb">
    <li><a href="/Home/Home">Home</a></li>
    <li><a href="/Core/Introduction"> Sanelib Core</a></li>
    <li class="active">Domain</li>
</ol>
   
            <div id="introduction">
                <h1 class="text-left">Domain</h1>
                <p>Domain has main content in Core. Domain have all setter and getter methods of entity. After all setter and getter method done, Domain contains From and To method.</p>
                <p>First 'To' method has pass one argument that a sql command. Sql command contain all parameter that to add by 'To' method. Add all parameter Like Name, Date of Birth, Address, etc. 'To' method in Ishouldpasssqlparameter class.</p>
                <pre><code>void To(SqlCommand cmd);</code></pre>
                <p>Second 'From' method has pass one argument that a Idatareader. 'From' method contain datareader that read data from command. Intilise the parameter by 'From' method.</p>
                <pre><code>void From(IDataReader dataReader);</code></pre>
                <p>In the domain extends by the Entity interface or implements by Audited Entity interface and Entity Implements by IEntity. Entity class content id one parameter that first intilise as empty, this check whether data same or not, data allready exits or not, read id 'From' command and add parameter to 'To' method.</p>
                <pre><code>public abstract class Entity : IEntity
    {
        public virtual Guid Id { get; set; }
                    .
                    .
    }
                    </code></pre>
                <p>In EntityName["Member"] that pass member string into entity class. Member class act as Entity.</p>
                <pre><code>[EntityName("Member")]
public class Member : AuditedEntity
    {
    }
</code></pre>
                <p>Domain content all parameter setter and getter method. In the domain some class extend by AuditedEntity and that contain getter and setter method of UserId, RevisionNumber and Opertion Time.</p>
                <p>AuditedEntity is diffrent then Entity. AuditedEntity's mentain the log. RevisionNumber and OpertionTime for mentain log file for AuditedEntity.</p>
                <pre><code>public class AuditedEntity : Entity, IAuditedEntity
    {
        public Guid? UserId { get; set; }
        public int RevisionNumber { get; private set; }
        public DateTime? OperationTime { get; private set; }
    }
</code></pre>

                <p>In IShouldReadDataReader contain From method and IshouldPassSqlParameter contain To method.</p>
                <pre><code>public interface IEntity : IShouldReadDataReader, IShouldPassSqlParameter
    {
        Guid Id { get; set; }
    }</code></pre>

            </div>
     